package com.jufanshare.myblog.service.article;

import com.jufanshare.myblog.entity.Article;
import com.jufanshare.myblog.service.base.BaseService;
import org.beetl.sql.core.engine.PageQuery;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface ArticleService extends BaseService<Article> {
    public Article mineInsert(Article article);
    public int updateTemplateById(Article article);
    public List<Article> findPosition();
    public List<Article> findAllId();
    /**
     * 首页数据（全部一起返回方便缓存管理）
     * @return
     */
    public Map<String,Object> homeData();

    /**
     * 分页数据，需要缓存管理
     * @param columnId
     * @param typeId
     * @param pageNum
     * @return
     */
    public PageQuery<Article> cachePageData(int columnId,int typeId,int pageNum,String sort);

    /**
     * 更新首页数据
     */
    public void flushArticleData();

    /**
     * 同类型文章查询
     * @param typeId
     * @return
     */
    public List<Article> listByType(int typeId);
    public void uvnumberAdd(int id, HttpServletRequest servletRequest);
    public void pvnumberAdd(int id, HttpServletRequest servletRequest);
}
